var Vbf=new function(){
	//get request pararmeter
	  this.getParameterByName = function(name) { name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(location.search); return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); }

	//syntaxHighlight
	this.syntaxHighlight = function(json) {
	    if (typeof json != 'string') {
		 json = JSON.stringify(json, undefined, 3);
	    }
	    json = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
	    return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) {
		var cls = 'number';
		if (/^"/.test(match)) {
		    if (/:$/.test(match)) {
		        cls = 'key';
		    } else {
		        cls = 'string';
		    }
		} else if (/true|false/.test(match)) {
		    cls = 'boolean';
		} else if (/null/.test(match)) {
		    cls = 'null';
		}
		return '<span class="' + cls + '">' + match + '</span>';
	    });
	}
	
	//micro template
	var cache = {};
 
  	this.tmpl = function tmpl(str, data){
	    // Figure out if we're getting a template, or if we need to
	    // load the template - and be sure to cache the result.
	    var fn = !/\W/.test(str) ?
	      cache[str] = cache[str] ||
		tmpl(document.getElementById(str).innerHTML) :
	     
	      // Generate a reusable function that will serve as a template
	      // generator (and which will be cached).
	      new Function("obj",
		"var p=[],print=function(){p.push.apply(p,arguments);};" +
	       
		// Introduce the data as local variables using with(){}
		"with(obj){p.push('" +
	       
		// Convert the template into pure JavaScript
		str
		  .replace(/[\r\t\n]/g, " ")
		  .split("<%").join("\t")
		  .replace(/((^|%>)[^\t]*)'/g, "$1\r")
		  .replace(/\t=(.*?)%>/g, "',$1,'")
		  .split("\t").join("');")
		  .split("%>").join("p.push('")
		  .split("\r").join("\\'")
	      + "');}return p.join('');");
	   
	    // Provide some basic currying to the user
		if ('undefined' === typeof data){};
	    return data ? fn( data ) : fn;
	  };

	//my mvc
	this.MVC= new function(){
		this.View = function(viewName, viewModel){
			var r = Vbf.tmpl("tmpl_" + viewName, {"ViewModel" : viewModel});
		    	$("#plhd_" + viewName).html(r);
		};
};
}
